<template>
    <div class="NewWallet">
        <div class="descs" v-if="items.float_message!=='-1'">
            <div class="icons">
                <i class="iconfont icon-qianbao-tishi"></i>
            </div>
            <div class="texts" style="display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;">
                {{items.float_message}}
            </div>
        </div>
        <div class="content">
            <div class="header" ref="header">
                <div class="bgimg">
                    <img src="../../assets/img/NewWallet/Wallet.svg" alt="">
                </div>
                <div class="text">
                    <div class="left">
                        <div class="">钱包余额 (¥)</div>
                        <div class="">
                            {{items.balance.toFixed(2).split('.')[0]}}<span>.{{items.balance.toFixed(2).split('.')[1]}}</span>
                        </div>
                        <div class="hantxt">含待结算 {{items.wait_balance|double}}</div>
                    </div>
                </div>
                <div class="right" @click="golink(items.wallet_qa_link)"><i class="iconfont icon-wenti"></i>钱包说明</div>
            </div>
            <ul>
                <li @click="go('Reflect')">
                    <div class="">
                        <i class="iconfont icon-qianbao1"></i>
                        提现到微信
                    </div>
                    <div class="">
                        可提现<span>¥{{items.withdraw_balance|double}}</span> <i class="iconfont icon-jinru"></i>
                    </div>
                </li>
                <li @click="go('Voucher')">
                    <div class="">
                        <i class="iconfont icon-buqiajuan"></i>
                        补学劵
                    </div>
                    <div class="">
                        兑换补学劵 <i class="iconfont icon-jinru"></i>
                    </div>
                </li>
                <li @click="go('Detailed')">
                    <div class="">
                        <i class="iconfont icon-shouzhimingxi1"></i>
                        收支明细
                    </div>
                    <div class="">
                        <i class="iconfont icon-jinru"></i>
                    </div>
                </li>
                <li @click="go('CashDetailed')">
                    <div class="">
                        <i class="iconfont icon-fanxianjilu2"></i>
                        返现记录
                    </div>
                    <div class="">
                        <i class="iconfont icon-jinru"></i>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'index',
        data: function () {
            return {
                items: {
                    balance: 0,
                    wait_balance: 0,
                    withdraw_balance: 0
                }
            }
        },
        mounted: function () {
            this.updata(this.$Login.oauth_token)
        },
        methods: {
            updata: function (data) {
                this.$axios.wallet_info(data).then(res => {
                    this.items = res.data.qing_data
                })
            },
            golink: function (str) {
                window.location.href = str
            },
            go: function (str) {
                this.$router.push({
                    name: str
                })
            }
        },
        components: {}
    }
</script>

<style scoped>
    @import "../../assets/css/views/NewWallet/index.css";

    .NewWallet > .descs > .texts {
        text-align: left;
        font-size: 1.2rem;
        color: #ff8400;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
</style>
